package com.tca.springmvc.learning.controller;

import com.alibaba.fastjson.JSONObject;
import com.tca.springmvc.learning.service.HelloService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.*;

/**
 * @author zhouan
 * @Date 2021/6/7
 */
@RestController
@RequestMapping("/hello")
public class HelloController {

    @Autowired
    private HelloService helloService;


    @GetMapping("/test")
    public String test() {
        long currentTimeMillis = System.currentTimeMillis();
        System.out.println(currentTimeMillis);
        return String.valueOf(currentTimeMillis);
    }

    @PostMapping("/message")
    public String message(@RequestBody JSONObject message) {
        System.out.println(message.toJSONString());
        return message.toJSONString();
    }

}
